package com.example.juc.vo;

import java.util.concurrent.TimeUnit;

public class JMMTest {
    private volatile static int num = 0;

    public static void main(String[] args) throws InterruptedException {

        new Thread(()->{
            while (num == 0){

            }
        }).start();

        TimeUnit.SECONDS.sleep(2);
        num = 1 ;
        System.out.println(num);

    }
}
